package com.rybbaby.tss.tasks.core.task.service.imp;

import com.rybbaby.tss.tasks.core.task.dao.ITssMemberCheckAttendanceDao;
import com.rybbaby.tss.tasks.core.task.entity.TssMemberCheckAttendance;
import com.rybbaby.tss.tasks.core.task.service.ITssMemberCheckAttendanceService;
import com.rybbaby.tss.tasks.core.web.service.imp.BaseServiceImp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @description 会员考勤记录表数据库操作服务实现
 * 
 * @author 雷春琼
 *
 * @createDate 2017-08-10 上午10:33:46
 */
@Service
@Transactional
public class TssMemberCheckAttendanceServiceImp extends BaseServiceImp<TssMemberCheckAttendance> implements ITssMemberCheckAttendanceService {

    @Autowired
    private ITssMemberCheckAttendanceDao tssMemberCheckAttendanceDao;

    @Override
    public List<Map<String, Object>> attendance(int attendenceStatus,int type)  throws Exception{
        //  查询本日考勤记录   待考勤、缺勤不扣课时、缺勤可补课、出勤

        List<Map<String, Object>> attendanceList = tssMemberCheckAttendanceDao.findAttendanceList(attendenceStatus,type);
        /*for (TssMemberCheckAttendance tssMemberCheckAttendance : attendanceList) {
            System.out.println(tssMemberCheckAttendance.getMemberId());
        }*/
        ArrayList<String> memberPackageIdList = new ArrayList<String>();
        /*for (Map<String, Object> map : attendanceList ) {
            String memberPackageId = (String) map.get("memberPackageId");
            System.out.println(memberPackageId);
        }*/
       /* for (int j = 0; j < attendanceList.size(); j++) {
            String memberPackageId = (String) attendanceList.get(j).get("memberPackageId");
            memberPackageIdList.set(j,memberPackageId);
        }*/
        // 扣课时

        //产生权责

        //System.out.println("-----------------------测试"+new Date()+"------------------------");
        return  attendanceList;
    }

}
